#ifndef __STATE_H__
#define __STATE_H__
#include "iostream"

class WokeSchedule;
class NoonState;
class AfternoonState;
class NightState;

/// @brief 工作状态基类
class WorkState
{
public:
    virtual void Behavior(WokeSchedule *woke) = 0;
};
/// @brief 工作进度
class WokeSchedule
{
public:
    int hour{};                  // 当前时间
    bool workFinish{false};      // 工作是否完成
    WorkState *m_state{nullptr}; // 当前状态
public:
    void SetState(WorkState *state)
    {
        m_state = state;
    }
    void ScheduleUpdate()
    {
        m_state->Behavior(this);
    }
};
/// @brief 上午工作状态
class ForenoonState : public WorkState
{
public:
    virtual void Behavior(WokeSchedule *woke) override;
};
/// @brief 中午工作状态
class NoonState : public WorkState
{
public:
    virtual void Behavior(WokeSchedule *woke) override;
};
/// @brief 下午工作状态
class AfternoonState : public WorkState
{
public:
    virtual void Behavior(WokeSchedule *woke) override;
};
/// @brief 晚上工作状态
class NightState : public WorkState
{
public:
    virtual void Behavior(WokeSchedule *woke) override;
};

#endif